<!-- 举报页面 -->
<template>
	<view>
		<feedbackContent :dataliist="datalist" @backtitle="backtitle" v-if="screen === 0" />
		<feedbackdetail :backtitledata="backtitledata" :basesort="basesort" :backtheid="backtheid" @sendfeedbackdetail="sendfeedbackdetail" v-else></feedbackdetail>
	</view>
</template>

<script>
	import feedbackdetail from '@/components/feedbackDetail/feedbackDetail.vue'
	import feedbackContent from '@/components/feedbackContent/feedbackContent.vue'
	import $http from '@/common/api/request.js'
	export default {
		data() {
			return {
				datalist:[],
				backtitledata:"",
				screen:0,
				backtheid:0,
				basesort:0
			};
		},
		methods:{
			getdata(){
				$http.request({
									url: "/Violationreporting",
								}).then((res) => {
									uni.showToast({
										title: "获取数据中...",
										icon: "none",
										mask: true,
										duration: 200,
										success: () => {
											this.datalist = res
										}
									})
								
								}).catch(() => {
								})
			}
			,backtitle(a,b){
				this.backtitledata = a;
				this.backtheid = b
				if(this.backtitledata)
				{
					this.screen =1
				}
			},
			sendfeedbackdetail(a){
				this.backtitledata = a;
				
				if(this.backtitledata)
				{
					this.screen =0
				}
			}
		},
		components:{
			feedbackdetail,feedbackContent
		},
		onLoad(e) {
			this.basesort = e.basesort
			this.getdata()
		}
	}
</script>

<style lang="scss">

</style>

